package com.calvin.study.multithread.threadlocal.transmit;

import java.util.concurrent.ThreadPoolExecutor;

import com.calvin.study.utils.ThreadUtil;

/**
 * 该类示例演示，如何使用ThreadLocal实现线程中跨类、跨方法的数据传递。
 * 
 */
public class Test {

	public static void main(String[] args) {

		ThreadPoolExecutor executor = ThreadUtil.getMixedTargetThreadPool();

		for (int i = 1, len = 100; i <= len; i++) {
			executor.execute(() -> {
				
			});
		}
		
		OrderService order = new OrderService();
		order.create();

		RepertoryService repertory = new RepertoryService();
		repertory.decrement();
	}

}
